<%--
   * 【描 述】：审核测试
   * 【环 境】：JAVA 1.7.0_13
   *  @author         柴志鹏  CHAIZP@GMAIL.COM
   *  @version        v1.0 2014-12-02
   *  @since          2014-12-02
 --%>
<%@ page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%>
<%@ include file="/include/head.jsp"%>
<html>
  <head>
    <title>审核流程管理</title>
    <style type="text/css">
    	.lctsm{
			text-align: center;
			line-height: 20px;
			color: blue;
			font-weight: bolder;
			font-size: 13px;
		}
		.dt{
		  	text-align:center;
			line-height:20px;
			color: #FF0000;
			font-weight: bolder;
			font-size: 13px;
		  }
    </style>
    <script type="text/javascript">
    	Ext.onReady(function() {
    		Ext.QuickTips.init();
    		Ext.form.Field.prototype.msgTarget = 'quip';
    		new Ext.Panel({
				region: 'center',
		   		height: 100,
		   		autoWidth: true,
				applyTo: Ext.getBody(),
				items: [
					new Ext.Button({
						text: 'aaa',
						handler: function() {
							Ext.Ajax.request({
								url: 'AuditAction!testProcess.do?id=998',
								method: 'POST',
								success: function (result,request){
									process(result.responseText, Ext.get("northInner"));
								}
							});
						}
					}),
					new Ext.Button({
						text: 'bbb',
						handler: function() {
							Ext.Ajax.request({
								url: 'AuditAction!testProcess.do?id=999',
								method: 'POST',
								success: function (result,request){
									process(result.responseText, Ext.get("northInner"));
								}
							});
						}
					})
				]
			});
    		
    		//http://www.studyofnet.com/news/408.html
    		//http://www.cnblogs.com/FredTang/archive/2012/08/09/2629991.html
    		function process(json, div) {
    			if(typeof(json) == "string") {
    				json = Ext.decode(json);
    			}
    			var tpl = new Ext.XTemplate(
    				'<table align="center" border="0">',
					    '<tr><tpl for=".">',// process the data.kids node
					    	'<td>',
					    		'<img src="<%=imagePath%>/process/{remark}/{[xindex]}.jpg" width=60 height=60 border=0>',
					    		'<p class="lctsm">测试{id}</p>',
					    	'</td>',
					    	'<td>',
					    		//xindex为在for循环时的下标
					    		//xcount循环对象的总合
					    		'<tpl if="xindex != xcount">',
				                    '<img src="<%=imagePath%>/process/jiantou.jpg" width=50 height=50 border=0>',
				                '</tpl>',
					    	'</td>',
					    '</tpl></tr>',
					'</table>'
				);
    			//tpl.overwrite(Ext.get("northInner"), json);
					
				new Ext.Panel({
					id: 'processPanel',
					region: 'north',
			   		autoHeight: true,
			   		autoWidth: true,
					applyTo: div,
					tpl: tpl,
					data: json
				});
				
    		}
    	});
    </script>
  </head>
  <body>
  	<div id="northInner"></div>
  </body>
</html>